package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class TravelQueryObject extends QueryObject {

    //高级查询条件
    private String keyword;

    private Integer state;
    private long uid;

    private Long destId = -1L;

    private Integer orderType = 1;

    private String order = "t.releaseTime desc";


    private Integer travelTimeType = -1;

    public TravelCondition getTravelTime() {

        return TravelCondition.travelTimes.get(travelTimeType);
    }

    private Integer dayType = -1;

    public TravelCondition getDay() {

        return TravelCondition.Days.get(dayType);
    }


    private Integer perExpendType;

    public TravelCondition getPerExpend() {

        return TravelCondition.PerExpend.get(perExpendType);
    }


    public String getOrder() {

        if (orderType == 1) {
            return "t.releaseTime desc";
        } else {
            return "t.viewnum desc";
        }
    }

}

